package com.willcode.demo.mvc.controller.web;

import com.willcode.demo.mvc.model.entity.TempUserInfo;
import com.willcode.demo.mvc.model.service.ITempUserInfoService;
import com.willcode.demo.mvc.view.model.Re;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Will
 */
@RestController
@RequestMapping(name = "TKMyBatis测试接口", value = "/springboot/tempuserinfo")
public class TempUserInfoController {

    @Autowired
    private ITempUserInfoService tempUserInfoService;

    @RequestMapping(value = "insert")
    public Re insert(TempUserInfo tempUserInfo) {
        return new Re("200", "TKMyBatis数据插入成功", tempUserInfoService.insert(tempUserInfo));
    }

    @RequestMapping(value = "deletebyid")
    public Re deleteByPrimaryKey(String id) {
        return new Re("200", "TKMyBatis数据删除成功", tempUserInfoService.deleteByPrimaryKey(id));
    }

    @RequestMapping(value = "updatebyid")
    public Re updateByPrimaryKey(TempUserInfo tempUserInfo) {
        return new Re("200", "TKMyBatis数据更新成功", tempUserInfoService.updateByPrimaryKey(tempUserInfo));
    }

    @RequestMapping(value = "selectbyprimarykey")
    public Re selectByPrimaryKey(String id) {
        return new Re("200", "TKMyBatis索引查找成功", tempUserInfoService.selectByPrimaryKey(id));
    }

    @RequestMapping(value = "selectall")
    public Re selectAll() {
        return new Re("200", "TKMyBatis全量查找成功", tempUserInfoService.selectAll());
    }

}
